/*
 * PANEImageElement.h
 *
 *  Created on: Apr 27, 2009
 *      Author: wrice
 */

#ifndef PANEIMAGEELEMENT_H_
#define PANEIMAGEELEMENT_H_
#include "PANEImp.h"
namespace PANEImp {

class PANEImageElement : public PANEElement, IMPLEMENTS( VisualImageForPANE ) {
protected:
	friend class PANEDocument;
	PANEImageElement(PANEDocument * doc);

public:
	virtual ~PANEImageElement();
	static string TagName;
	static string AttrNameSrc;

public: // from PANEElement
	virtual unsigned long getWidth();
	virtual unsigned long getHeight();

public: // new for image
	virtual DOMString getSrc();
	virtual void setSrc(DOMString src);

public: // from VisualSegmentForPANE
	virtual unsigned long getActualWidth( unsigned long availableWidth );
	virtual unsigned long getActualHeight( unsigned long availableHeight );

public: // from VisualImageForPANE
	virtual DOMString getImageURL();
	virtual bool getIsLoaded();


public: // from RenderableWithOpenCV
	virtual void render( IplImage * img );

private:
	IplImage * cvImg_;
	string loadedURL_;

	void loadURL();
};

}

#endif /* PANEIMAGEELEMENT_H_ */
